package com.tm.mapper;

import com.tm.pojo.UserPojo;
import com.tm.pojo.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author xiaobai
 * @create 2022-12-17 21:34
 */
@Mapper
public interface UserMapper {
    @Select("SELECT  " +
            "user_id AS 'userId', " +
            "user_name AS 'userName', " +
            "user_head_img AS 'userHeadImg', " +
            "user_age AS 'userAge', " +
            "business_id AS 'businessId', " +
            "beautician_user_id AS 'beauticianUserId', " +
            "user_sex AS 'userSex', " +
            "user_phone AS 'userPhone' " +
            "FROM  " +
            "t_user " +
            "WHERE " +
            "user_name = #{userName}  " +
            "AND " +
            "user_pwd = #{userPwd}" )
    UserVo queryUser1(@Param("userName") String userName, @Param("userPwd") String userPwd);

    @Select("SELECT  " +
            "user_id AS 'userId', " +
            "user_name AS 'userName', " +
            "user_head_img AS 'userHeadImg', " +
            "user_age AS 'userAge', " +
            "business_id AS 'businessId', " +
            "beautician_user_id AS 'beauticianUserId', " +
            "user_sex AS 'userSex', " +
            "user_phone AS 'userPhone' " +
            "FROM  " +
            "t_user " +
            "WHERE " +
            "user_phone = #{userPhone}  ")
    UserVo queryUser2(@Param("userPhone") String userPhone);
}
